/*
 * The MIT License (MIT)
 * Copyright (C) 2023 Huawei Device Co., Ltd.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 */
import http from '@ohos.net.http';
import axios, { AxiosResponse } from '@ohos/axios'
export interface IdModel {
  id?: number
}

interface UrlModel {
  url: string
}

export interface UploadModel {
  code: number,
  msg: string,
  ts: string,
  data: UrlModel
}

export interface InfoModel {
  id: number
  name: string
  briefDesc: string
  author: string
  licence: string
  gitUrl: string
  keyword: string
}

export interface ConfigModel {
  defaultUrl: string,
  path: string,
  getUrl: string,
  postUrl: string,
  downloadUrl: string,
  uploadUrl: string,
}

export interface NormalResultModel {
  code: number,
  data: Object,
  msg: string,
  pageNum: number,
  pageSize: number,
  totalNum: number,
  totalPage: number
}

export interface PostDataModel {
  pageNum: number,
  pageSize: number,
  newDate: number
}

export interface DownLoadResultModel {
  data: string
}

export interface UploadResultModel {
  code: number,
  msg: string,
  ts: string,
  data: UrlModel
}

export interface Log {
  TAG: string,
  DOMAIN: number,
}

export interface Xts_config {
  path_oneWayAuth: string,
  path_mutualAuth_noPsw: string,
  path_mutualAuth_hasPsw: string,
  path_certificate_pin: string,
  defaultUrl: string,
  path: string,
  getUrl: string,
  postUrl: string,
  downloadUrl: string,
  uploadUrl: string,
  url: string,
  baseURL: string,
  host: string,
  proxyHttps: string,
  proxyHttp: string,
  psw: string
}

export interface Demo_config {
  baseUrl: string,
  getUrl: string,
  postUrl: string,
  putUrl: string,
  deleteUrl: string,
  downloadUrl: string,
  uploadUrl: string,
  clientCert_noPsw: string,
  clientCert_hasPsw: string,
  proxyUrl: string,
  host: string,
  psw: string,
}

export default class  TokenObject {
  'connection': string
  'Content-Length': string
  'Content-type':string
  'date': string
  'server': string
  'set-cookie':string
  'strict-transport-security':string
  'x-content-type-options':string
  'x-download-options':string
  'x-frame-options':string
  'x-iam-trace-id': string
  'x-request-id': string
  'x-subject-token':string
};

// 定义接口以匹配返回的数据结构
export interface ShadowDevice {
  service_id: string;
  desired: {
    properties: any;
    event_time: any;
  };
  reported: {
    properties: {
      温度: number;
      湿度:number;
      光照强度:number
    };
    event_time: string;
  };
  version: number;
}

export interface DeviceResponse {
  device_id: string;
  shadow: ShadowDevice[];
}

export interface DeviceResponseAlm {
  device_id: string;
  shadow: ShadowDeviceAlam[];
}

export interface ShadowDeviceAlam {
  service_id: string;
  desired: {
    properties: any;
    event_time: any;
  };
  reported: {
    properties: {
      烟雾: number
    };
    event_time: string;
  };
  version: number;
}

